package com.wangyadong.hobby.schedule.jobtask;

import java.util.LinkedList;

/**
 * <p>
 *
 * @author <714037465@qq.com>
 * @since 2018/10/818:06
 **/
public class LinkedQueue<E> implements Queue {
    private LinkedList linkedList = new LinkedList();

    @Override
    public int size() {
        return linkedList.size();
    }

    @Override
    public boolean isEmpty() {
        return size() == 0;
    }

    @Override
    public void enqueue(Object o) {
        linkedList.add(o);
    }

    @Override
    public Object first() {
        return linkedList.getFirst();
    }

    @Override
    public Object dequeue() {
        return linkedList.removeFirst();
    }
}
